﻿@{
    ViewBag.Title = "广铁报社图片库  首页";
    ViewBag.Background = "(" + Url.Content("~/Content/images/Home/bg-body.gif") + ");background-repeat:repeat-y;background-color:#f0f0f0";
}

<script type="text/javascript">
    $(document).ready(function () {
        $("#main-nav li ul").hide(); // Hide all sub menus
        $("#main-nav li a.current").parent().find("ul").slideToggle("slow"); // Slide down the current menu item's sub menu
        $("#main-nav li a.nav-top-item").click( // When a top menu item is clicked...
			function () {
			    $(this).parent().siblings().find("ul").slideUp("normal"); // Slide up all sub menus except the one clicked
			    $(this).next().slideToggle("normal"); // Slide down the clicked sub menu
			    return false;
			}
		);
        $("#main-nav li a.no-submenu").click( // When a menu item with no sub menu is clicked...
			function () {
			    window.location.href = (this.href); // Just open the link instead of a sub menu
			    return false;
			}
		);
        // Sidebar Accordion Menu Hover Effect:
        $("#main-nav li .nav-top-item").hover(
			function () {
			    $(this).stop().animate({ paddingRight: "25px" }, 200);
			},
			function () {
			    $(this).stop().animate({ paddingRight: "15px" });
			}
		);
        // 获取右边主题区域的宽度
        var width = $(window).width() - 230;
        $("#main-content").width(width);
    });

    $(window).bind("resize", function () {
        // 获取右边主题区域的宽度
        var width = $(window).width() - 230;
        $("#main-content").width(width);
    });

    function navigation(element, title, item) {
        //调用ChangeCss函数用以改变当前样式
        ChangeCss(element, "subMenuItem");
        if (title == "网站栏目") {
            $("#mainFrame").attr("src", "@Url.Content("~/Content/Index")?栏目ID=" + item);
        };
        if (title == "图片库管理") {
            if (item == "我的图片") {
                $("#mainFrame").attr("src", "@Url.Content("~/Manager/MyPictures")");
            }
        };
        if (title == "个人设置") {
            //请设置跳转页面
        };
   }

    function ChangeCss(element, classStyle) {
        if (classStyle == "subMenuItem") {
            $("#main-nav li ul a").removeAttr("style");
            $(element).css({
                "font-weight": "bold",
                "color": "#fff",
                "background": "transparent url('@Url.Content("~/Content/images/Home/menu-current-arrow.gif")') right center no-repeat !important"
            });
        };
        if (classStyle == "MenuItem") {
            $("#main-nav li a").removeAttr("style");
            $(element).css({
               "font-weight": "bold",
                "color": "#333",
                "background": "transparent url('@Url.Content("~/Content/images/Home/bg-menu-item-current.gif")') center no-repeat !important"
            });
        };
}
</script>

<div id="body-wrapper">
    <div id="sidebar">
        <div id="sidebar-wrapper">
            <!-- Sidebar with logo and menu -->
            <!-- Logo (221px wide) -->
            <a href="#">
                <img id="logo" src="@Url.Content("~/Content/images/Home/Userinfo.png")" alt="Logo" /></a>
            <!-- Sidebar Profile links -->
            <div id="profile-links">
                Hello, <a style="font: #fff">865171</a><br />
                <br />
                <a href="#" title="上传图片">上传图片</a> | <a href="#" title="退出">退出</a>
            </div>
            <ul id="main-nav">
                <!-- Accordion Menu -->
                <li><a href="#" class="nav-top-item no-submenu" onclick=ChangeCss(this,"MenuItem")>
                    <!-- Add the class "no-submenu" to menu items with no sub menu -->
                    报社首页 </a></li>
                <li><a href="#" class="nav-top-item" onclick=ChangeCss(this,"MenuItem")>
                    <!-- Add the class "current" to current menu item -->
                    栏目导航 </a>
                    <ul>
                        @foreach (var item in ViewBag.网站栏目)
                        {
                            <li><a href="#" onclick=navigation(this,"网站栏目",@item.栏目ID)>@item.栏目名称</a></li>
                        }
                    </ul>
                </li>
                <li><a href="#" class="nav-top-item" onclick=ChangeCss(this,"MenuItem")>图片库管理 </a>
                    <ul>
                        @foreach (var item in ViewBag.图片库管理)
                        {
                            <li><a href="#" onclick=navigation(this,"图片库管理","@item")>@item</a></li>
                        }
                    </ul>
                </li>
                <li><a href="#" class="nav-top-item" onclick=ChangeCss(this,"MenuItem")>个人设置 </a>
                    <ul>
                        @foreach (var item in ViewBag.个人设置)
                        {
                            <li><a href="#" onclick=navigation(this,"个人设置","@item")>@item</a></li>
                        }
                    </ul>
                </li>
            </ul>
        </div>
    </div>
    <div id="main-content">
        <iframe id="mainFrame" style="width: 100%; height: 100%;" scrolling="auto" frameborder="0" src="@Url.Content("~/Content/Index?栏目ID=1")"></iframe>
    </div>
</div>
